#include <iostream>
#include "contacts.pb.h"
using namespace std;
int main()
{
    contacts::contact conn;
    conn.set_sn(10001);
    conn.set_name("康康");
    conn.set_score(60);

    std::string str = conn.SerializeAsString();

    contacts::contact stu;
    bool ret = stu.ParseFromString(str);
    if(ret == false)
    {
        cout<<"反序列化失败"<<endl;
    }
    cout<<stu.sn()<<endl;
    cout<<stu.name()<<endl;
    cout<<stu.score()<<endl;
    return 0;
}